/*************************************************************************
    > File Name: test.c
    > Author: ma6174
    > Mail: ma6174@163.com 
    > Created Time: Tue 04 Mar 2025 10:19:12 PM CST
 ************************************************************************/

#include<stdio.h>
#include<string.h>

int main()
{
	FILE * fp = fopen("log.txt","w");           //以写的形式打开log.txt文件
	if(fp == NULL)
	{
		perror("fopen error");
		return 1;
	}
	const char* msg = "hello world!\n";
	int count = 5;
	while(count--)
	{
		fwrite(msg,strlen(msg),1,fp);
	}
	fclose(fp);                                 //关闭文件
	return 0;
}
